<template>
  <div>
    <Tool />
    <PaginationCard
      :total="totalCount"
      :page-size="maxResultCount"
      @sizeChange="handleSizeChange"
      @currentChange="handleCurrentChange"
    >
      <Table slot="table" :list="list" />
    </PaginationCard>
  </div>
</template>

<script>
import Tool from './components/audit/Tool'
import PaginationCard from '@/components/PaginationCard'
import Table from './components/audit/Table'
// import { getAuditLog } from '@/http/modules/audit'
export default {
  components: { Tool, PaginationCard, Table },
  data() {
    return {
      list: [],
      maxResultCount: 10,
      currentPage: 1,
      totalCount: 0
    }
  },
  mounted() {
    const vm = this
    vm.getLogs()
  },
  methods: {
    handleSizeChange(num) {
      const vm = this
      vm.currentPage = 1
      vm.maxResultCount = num
      vm.getLogs()
    },
    handleCurrentChange(num) {
      const vm = this
      vm.currentPage = num
      vm.getLogs()
    },
    getLogs() {
      // const vm = this
      // const query = {}
      // getAuditLog(vm.currentPage, vm.maxResultCount, query).then(res => {
      //   vm.list = res.items
      //   vm.totalCount = res.totalCount
      // })
    }
  }
}
</script>

<style lang="scss" scoped></style>
